//related to header2.ui
var cacher = sm("do_DataCache");
var root = ui("$");// 或者var root = ui("root");

var app = sm('do_App');
var page = sm("do_Page");
var acount = ui("acount");
var listdata = mm("do_ListData");
//定义UI组件
var back_btn = ui("back_btn");
var do_Button_Forward = ui("do_Button_Forward");
var service_url = sm("do_Global");
var url  = service_url.getMemory("service_url");

//点击下一步跳转界面
do_Button_Forward.on("touch", function() {
	
	
	getmembers();
	

})
function getmembers(){
	var http = mm("do_Http");
	http.method = "GET";
	http.timeout = 30000;
	http.contentType = "application/json";
	http.setRequestHeader("X-Requested-With", "XMLHttpRequest");
	var token = cacher.loadData("token");
	http.setRequestHeader("Cookie", token+"");
	http.url = url+"index.php?s=/admin/member/memberlist";
	http.body = "search_text="+acount.text;
	http.on("success", function(data) {
		//nf.toast(data);
		//将数据添加到组件中
		
		var mdata = data.data[0];
		mdata.valueStore = ui('money').text;
		deviceone.print(JSON.stringify(data.data[0]),"data");
		app.openPage({
			source:"source://view/storedvalue/storedvaluedetail.ui", 
			data:data.data[0]
			});
	});
	http.request();
}
page.on('back',function(){
	app.closePage(page);
});

/*****返回按钮*****/
back_btn.on("touch",function(){
	app.closePage(page);
});

 var do_Picker = ui("do_Picker");
do_Picker.bindItems(listdata);
var datas = [ "满一百减一百", "满两百减两百", "买的多减的多" ];
listdata.addData(datas);
do_Picker.refreshItems();